/*
 * CalibrationArea.h
 *
 *  Created on: 2014-3-10
 *      Author: Mahome
 */

#ifndef CALIBRATIONAREA_H_
#define CALIBRATIONAREA_H_

/**********************上传相关配置信息*********************/
#define UploadPeriod		10000		//unit is ms
#define RecPeriod			1000			//unit is ms
/**********************单体电池信息单独处理*********************/
#define MaxTempCNT 			6			//共计缓存MaxTempCNT个温度包
#define MaxVolCNT 			28			//共计缓存MaxVolCNT个温度包
#define TempPackLen			1			//每个TCP包中，发TempPackLen个温度包
#define VolPackLen			4			//每个TCP包中，发VolPackLen个电压包

#define TmpCANID			0x18FFB3F3		// 温度ID
#define VolCANID			0x18FFB2F3		// 电压ID
#define CellInfoChannel		2				// 单体信息在哪个CAN通道上接收

/**********************统计信息配置*********************/
#define VehicleSpeedCANID				0x08FA4201
#define VoltageCANID					0x14209CF4
#define CurrentCANID					0x0C219CF4

#define VehicleSpeedVlv(p)				((*((p)+1)<<8)+*(p))*0.1
#define VoltageVlv(p)					((*((p)+1)<<8)+*(p))*0.01
#define CurrentVlv(p)					((*((p)+1)<<8)+*(p))*0.01

//#define NewProtocalDebug
#define SIM_Rest
typedef enum
{
	_1s = 1,
	_2s,
	_3s,
	_4s,
	_5s,
	_6s,
	_7s,
	_8s,
	_9s,
	_10s,
}GPRS_Perioid ;
typedef enum
{
	_100ms = 1,
	_200ms,
	_300ms,
	_400ms,
	_500ms,
	_600ms,
	_700ms,
	_800ms,
	_900ms,
	_1000ms,
}SD_Perioid ;

typedef struct
{
	CAN_Baudrate NOD0;
	CAN_Baudrate NOD1;
} CAN_BRstr;

typedef struct
{
	EnORDisable EnableCtr;
	CAN_IDtype IDType;
	CANMoDLC MoDLC;
	ulong CANID;
}MOConfig ;

typedef struct
{
	ubyte AD_SampleTimeConfig[4];			//100ms的倍数
}ADC_CfgStr;

extern char SoftwareVersion[];
extern char IP_Port[40];
extern const MOConfig CH1_MO[30];
extern const MOConfig CH2_MO[30];
extern const CAN_BRstr CAN_BR;
extern const ADC_CfgStr ADC_Config;
extern const GPRS_Perioid GPRSSend_Perioid ;
extern const SD_Perioid SEREC_Perioid ;
extern ubyte CANRxData[60][8];		//用于存放对应的CAN消息

#endif /* CALIBRATIONAREA_H_ */
